var ClubGroup_Hehuorenchengyuan_Item = Item.extend({
    _ccsFileName: res.ClubGroup_Hehuorenchengyuan_Item_json,
    _clubId: null,
    _userData: {},
    initItem: function (p1, p2, p3, p4) {
        this._userData = p1;
        this._clubId = p2;
    },
    refreshData: function (data) {
        this._userData = data;
        var stateObj = this._getUserState();
        var statusObj = this._getUserStatus();
        loadHeadImage(this._userData.h, this._nodeList['mergeData.sp_head'], true);
        this._nodeList['mergeData.txt_name'].setString(this._userData.n);
        this._nodeList['mergeData.txt_id'].setString(this._userData.u);
        this._nodeList['mergeData.txt_state'].setString(stateObj.state);
        this._nodeList['mergeData.txt_state'].setTextColor(statusObj.color);
        this._nodeList['mergeData.txt_identity'].setString(statusObj.status);
        this._nodeList['mergeData.txt_identity'].setTextColor(statusObj.color);
    },
    /**
     * 获取成员状态
     * @returns {{state: string, color: (cc.Color|Object)}}
     * @private
     */
    _getUserState: function () {
        var state = '离线';
        var color = cc.color(115, 115, 115);

        if (this._userData['s'] == 1) {
            state = '在线';
            color = cc.color(39, 182, 49);
        }
        if (this._userData['s'] == 2) {
            state = '游戏中';
            color = cc.color(255, 10, 10);
        }

        return {state: state, color: color};
    },

    /**
     * 获取成身份
     * @private
     */
    _getUserStatus: function () {
        var status = '成员';
        var color = cc.color(214, 131, 43);
        if (this._userData['u'] == this._userData['partnerUid']) {
            status = '合伙人';
            color = cc.color(214, 131, 43);
        }
        //群主 指定显示操作按钮
        return {status: status, color: color};
    },
});